package edu.lingnan.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import edu.lingnan.pojo.MyOrder;
import edu.lingnan.pojo.ProductOrder;
import edu.lingnan.service.ProductOrderService;
import edu.lingnan.mapper.ProductOrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 */
@Service
public class ProductOrderServiceImpl extends ServiceImpl<ProductOrderMapper, ProductOrder>
    implements ProductOrderService{

    @Autowired
    private ProductOrderMapper productOrderMapper;

    @Override
    public int deleteProductOrderByOrderId(Long id) {
        return productOrderMapper.deleteProductOrderByOrderId(id);
    }

    @Override
    public void addProductOrder(MyOrder order , Long productId) {
        productOrderMapper.addProductOrder(order,productId);
    }

    @Override
    public int selectProductOrderByProductId(Long productId) {
        return productOrderMapper.selectProductOrderByProductId(productId);
    }

    @Override
    public void updateProductOrderNumber(Long productId) {
        productOrderMapper.updateProductOrderNumber(productId);
    }

    @Override
    public List<ProductOrder> selectProductOrderByOrderIds(List<Long> orderIdList) {
        return productOrderMapper.selectProductOrderByOrderIds(orderIdList);
    }


}




